﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace MaterialEditor
{
    public class TextureContainer
    {
        public DynamicTexture texture;
        
        /// <summary>
        /// Creates a new instance of Texture container
        /// </summary>
        /// <param name="texture">The texture to put into the container</param>
        public TextureContainer(Texture2D texture)
        {
            this.texture = texture;
        }

        /// <summary>
        /// Copies one texture container to the other
        /// </summary>
        /// <param name="other">The texture container to copy from</param>
        public TextureContainer(TextureContainer other)
        {
            texture = new DynamicTexture(other.texture.Material);
            texture.effects += other.texture.effects;
        }

        /// <summary>
        /// Draws the texture over the specified rectangle
        /// </summary>
        /// <param name="rect">The rectangle to draw the texture on</param>
        public void Draw(System.Drawing.Rectangle rect)
        {
            Graphics g = Graphics.Instance;

        }

        public static implicit operator TextureContainer(Texture2D tex)
        {
            return new TextureContainer(tex); 
        }
    }
}